import {createRouter,createWebHashHistory} from 'vue-router'
const Main = ()=>import('@/components/index')
const Home = () =>import('@/components/Home')
const User = () =>import('@/components/User')
const About = () =>import('@/components/About')
const Login = ()=>import('@/components/Login')
const routes = [
    {
        path:"/",
        redirect:'/home'
    },
    {
        path:'/main',
        name:'main',
        component:Main,
        children: [
            {
                path:'/home',
                name:'home',
                component:Home,
                meta:{
                    title:'首页'
                }
            }, {
                path:'/user',
                name:'user',
                component:User,
                meta:{
                    title:'用户中心'
                }
            },
            {
                path:'/about',
                name:'about',
                component:About,
                meta:{
                    title:'关于你的'
                }
            }]
    },{
        path:"/login",
        name:'login',
        component:Login,
    },
]
const router = createRouter({
    history:createWebHashHistory(),
    routes
})
export default router
